Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid change attributes into the constructor in Apache Beam operators #37934

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

Taragolis
Copy link
Contributor

Avoid operation (assign, checks, cast) on potential templated fields into the Apache Beam Operators, all logic moved into the execute method
Avoid use mutable in the session scope into the tests.
Avoid create operators before test cases

In addition I install locally pytest-random-order and run for about 20 times pytest tests/providers/apache/beam/operators/test_beam.py --random-order without any side effect

Operators still have a lot of logic which assign a lot of attributes into the runtime in specific order.
BeamDataflowMixin looks useless because it only provided private methods and assign to the all operators.
But maybe this should be resolved as a follow up.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@Taragolis Taragolis requested a review from potiuk March 6, 2024 11:21
@Taragolis Taragolis changed the title Avoid change attributes into the init method in Apache Beam operators Avoid change attributes into the constructor in Apache Beam operators Mar 6, 2024
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!

@potiuk potiuk merged commit 2ce28d5 into apache:main Mar 8, 2024
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants